using namespace std;
#include <iostream>
#include <cstring>
class point
{
    private:
        double labelx;
        double labely;
    public:
        point():labelx(0),labely(0){}
        point(double labelx,double labely){};
        point(point &point){};
        ~point (){};
        void setlabelx(double labelx) { this->labelx = labelx; }
        double getlabelx() const { return labelx; }
        void setlabely(double labely) { this->labely = labely; }
        double getlabely() const { return labely; }
};
class map
{

};
class tank
{
    private:
        double labelx;
        double labely;
        int num;            //子弹数目

    public:
    tank():labelx(0),labely(0),num(3){}
    tank(double labelx,double labely,int num){};
    void left() { this->labelx--; }
    void right() { this->labelx++; }
    void up() { this->labely++; }
    void down() { this->labely--; }      //坦克移动函数
    void fire() { this->num--; }
    void setlabelx(double labelx) { this->labelx = labelx; }
    double getlabelx() const { return labelx; }
    void setlabely(double labely) { this->labely = labely; }
    double getlabely() const { return labely; }
    void setnum(int num) { this->num = num; }
    int getnum() const { return num; }
};
int main()
{
    tank *tank1 = new tank;
    cout << "当前所在位置为（" << tank1->getlabelx() <<"."<< tank1->getlabely() <<")   "<<"剩余子弹数目: "<< tank1->getnum() <<endl;
    cout << "输入指令(a/w/s/d/j)：" ;
    char direction;
    cin >> direction;
    switch(direction)
    {
        case 'w': 
            tank1->up();
            break;
        case 's': 
            tank1->down();
            break;
        case 'a': 
            tank1->left();
            break;
        case 'd': 
            tank1->right();
            break;
        case 'j':
            tank1->fire();
            cout <<"攻击";
    }
    cout << "当前所在位置为（" << tank1->getlabelx() <<"."<< tank1->getlabely() <<")   "<<"剩余子弹数目: "<< tank1->getnum() <<endl;
    delete tank1;
    tank1 = nullptr;
    return 0;
}